import React from "react";
import { BrowserRouter, useRoutes, Navigate } from "react-router-dom";

const AntPay = React.lazy(() => import("../views/antPay"));
const AntPayDetail = React.lazy(() => import("../views/antPayDetail"));
const AntPayTab = React.lazy(() => import("../views/antPayTable"));
const ROUTER_LIST = [
  {
    path: "/AntPay",
    element: <AntPay></AntPay>,
  },
  {
    path: "/AntPayDetail",
    element: <AntPayDetail></AntPayDetail>,
  },
  {
    path: "/AntPayTab",
    element: <AntPayTab></AntPayTab>,
  },
  {
    path: "/",
    element: <Navigate to="/AntPay"></Navigate>,
  },
];
const RouterView = () => {
  const Router = () => useRoutes(ROUTER_LIST);
  return (
    <BrowserRouter>
      <Router></Router>
    </BrowserRouter>
  );
};

export default RouterView;
